package com.vastcom.tyauthcenter.dao;


import com.vastcom.tyauthcenter.model.Rightresource;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface RightResourceDao extends JpaRepository<Rightresource,String> {

    @Query("select r from Rightresource r where r.type=:type order by r.sort")
    List<Rightresource> getRightresourceByType(@Param("type") String type);

    @Query("select r from Rightresource r where r.pid=:pid order by r.sort")
    List<Rightresource> getRightresourcesByPid(@Param("pid") String pid);
}
